﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SLSYJ.Core.DataInterfaces;
using SLSYJ.Core;
using NHibernate;
using ProjectBase.Data.NHibernate;
using NHibernate.Criterion;

namespace SLSYJ.Data
{
    public class SectorDao : GenericDao<Sector>, ISectorDao
    {
        #region IPlusDao Members

        public List<Sector> LoadSectorBy(string sectorName)
        {
            ICriteria criteria = Session.CreateCriteria(typeof(Sector))
                .Add(Expression.Eq("Name", sectorName));

            return criteria.List<Sector>() as List<Sector>;
        }

        #endregion
    }
}
